<?php

namespace XWAM\Model;

/**
 * Description of UserModel
 *
 * @author SoChishun 2017-4-12
 */
class AreaModel extends AppbaseModel {

    protected $tableName = 't_porg_area';

    public function getProvinces() {
        return $this->where(array('level' => 1))->select();
    }

    public function getCity($pid) {
        return $this->where(array('pid' => $pid, 'level' => 2))->select();
    }

    public function getArea($pid, $cid) {
        return $this->where(array('pid' => $pid, 'cid' => $cid, 'level' => 3))->select();
    }

}
